<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\modules\comment\models\Comment */

$this->title = '评论详细';
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', '评论详细'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<input type="hidden" name="_csrf" id='csrf' value="<?= Yii::$app->request->csrfToken ?>">
<div class="comment-view" style="text-align: center">
    <div style="width: 100%;height: 80px;border: 3px solid ghostwhite;padding: 25px;">
        <p><span style="font-weight: bolder;font-size: 18px;"><?=$model->user_name?></span> 于2017-10-20的 对 <span style="font-weight: bolder;font-size: 18px;"><?=$commentArr['goods_name']?></span> 评论</p>
    </div>
    <div style="width: 100%;border: 3px solid ghostwhite;padding: 25px;margin-top: 10px;">
        <h4>内容：</h4>
        <span style="font-size: 18px;">
            <?=$model->content?>
        </span>
    </div>
    <?php if($model->is_show==0){ ?>
        <button id="show" class="btn btn-update" style="margin-top: 20px;">允许显示</button>
    <?php } else { ?>
        <button id="show" class="btn btn-update" style="margin-top: 20px;">不允许显示</button>
    <?php } ?>
</div>
<script>
    var csrf  = $('#csrf').val();
    $('#show').click(function(){
        $.ajax({
            url: '?r=comment/comment/show',
            type: 'post',
            data: {_csrf:csrf,comment_id:'<?=$model->comment_id?>','is_show':<?=$model->is_show?>},
            success: function (data) {

            }
        })
    })

</script>
